#include "bsp_uart.h"
#include "usart.h"
#include "RC.h"
//#include "ili9488.h"
#include "stdio.h" 
#include "string.h"


Rx_DataTypeDef RX_Buffer;

uint8_t Bool_Rx(uint8_t* data) 
{
    if (data[0] != 0xAA) 
	{
        return 0;
    }   
    if (data[22] != 0xBB)		
	{ 
        return 0;
    }
    return 1;
}

void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
    if(huart->Instance == USART1) 
    {
		uint8_t data[23];
		if(Bool_Rx(data)==1)
		{
			RC_Callback(&RC_Data,data,&RX_Buffer);
		}	
        HAL_UART_Receive_IT(&huart1, (uint8_t*)data, 23);
	}
}
